﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Quartz;

namespace QuartzJob.JobWork
{
    // 2. 创建一个触发器
    public class SendMessageTriggerServer
    {
        public ITrigger SendMessageTrigger()
        {
            var trigger = TriggerBuilder.Create()
                .WithIdentity("定时发送消息", "作业触发器")
                .WithSimpleSchedule(x => x
                    .WithIntervalInSeconds(10)
                    // .WithIntervalInHours(5)
                    //.WithIntervalInMinutes(1) //每1分钟执行一次
                    .RepeatForever())
                .Build();
            return trigger;
        }
    }
}